import { httpRequest } from "@/untils/httpRequest.ts";
import {triggerDelay} from '@/untils/untils'

// worker线程接收主线程信息
self.onmessage = (e) => {
    const { message } = e.data;
    console.log('在worker中接收到消息，Received message in worker', message);
    triggerDelay()
    httpRequest("get", "/test", null, null, "proxy").then(res => {
        // 将结果发送回主线程
        self.postMessage(JSON.stringify(res.data));
    })
}